package com.travel.server.manager.impl.sal;

import com.travel.common.util.CollectionUtil;
import com.travel.server.manager.impl.dal.ProjectDal;
import com.travel.server.manager.model.ProjectInfo;
import com.travel.server.manager.model.ProjectSpecial;
import com.travel.server.manager.model.dto.data.OrderCostItemDto;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author: LiZhenhui
 * @Date: 2018\12\1 0001 22:22
 * @Desc:
 */
public class ProjectCostSal {

    public static Map<Integer, Integer> makeCostMap(List<OrderCostItemDto> list, int type){
        Map<Integer, Integer> param = new HashMap<>();
        if(!CollectionUtil.isEmpty(list)){
            for(OrderCostItemDto dto : list){
                if(1 == type) {
                    param.put(dto.getSpecialId(), dto.getOrderAmount());
                }else if(2 == type){
                    param.put(dto.getSpecialId(), dto.getApplyAmount());
                }else if(3 == type){
                    param.put(dto.getSpecialId(), dto.getDiscountAmount());
                }else{
                    param.put(dto.getSpecialId(), dto.getCount());
                }
            }
        }
        return param;
    }
}
